/*
 * @Author: 迷洛洛ywc
 * @Date: 2024-05-31 11:07:10
 * @LastEditors: 迷洛洛ywc
 * @LastEditTime: 2024-06-12 14:31:37
 * @Description: file content
 */
import request from '@/utils/request'
// 溯源数据
export const getDetailByIdApi = (id) =>
  request.get(`/tracingsource/getDetailById/${id}`)
// 获取农事计划
export const getAgrByLandIdApi = (id) =>
  request.get(`/agriculturalarchives/getAgrByLandId/${id}`)
// 获取种植地块信息
export const getLandInfoApi = (params) =>
  request.get(
    `/landinfo/list?baseId=${params.baseId}&landId=${params.landId}`
  )
// 农残检测报告
export const getpesticideResiduesByIdApi = (id) =>
  request.get(`/pesticideResidues/getDetailById/${id}`)
// 根具id土壤水质检测报告
export const getSamplingReportByIdApi = (params) =>
  request.get(
    `/samplingreport/getByCondition?id=${params.id}&reportType=${params.reportType}`
  )
// 统计溯源次数
export const getTracingNumApi = (params) =>
  request.get(
    `scanningTime/timeInc?traId=${params.id}&time=${params.time}&baseId=${params.baseId}`
  )
// 溯源删除
export const delTracingApi = (id) =>
  request.delete(`/tracingsource/removeByIds?ids=${id}`)
// 水质土壤报告列表 reportType -报告类型 0土壤 1水质
export const getReportListApi = (params) =>
  request.get(
    `/samplingreport/page?baseId=${params.baseId}&current=${params.current}&size=${params.pageSize}&reportType=${params.reportType}`
  )
  // 农残报告列表
export const getPesticideReportListApi = (params) =>
  request.get(
  `/pesticideResidues/page?baseId=${params.baseId}&current=${params.current}&size=${params.pageSize}`
  )
// 上传头像
export const fileImgApi = (data) =>
  request.post('/oss/uploadFilePicture', data, {
    headers: { 'Content-Type': 'multipart/form-data' }
  })
// 编辑溯源码
export const editSuyuanDetailApi = (data) => request.patch('/tracingsource/updateById', data)
